<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>修改密码--layui后台管理模板</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<script type="text/javascript" src="__ROOT__/static/plugins/jquery/jquery-1.11.2.min.js"></script>
	<script type="text/javascript" src="__ROOT__/static/plugins/Validform_v5.3.2/Validform_v5.3.2_min.js"></script>
	<script src="__ROOT__/static/plugins/layer/layer.min.js"></script>
	<script src="__ROOT__/static/plugins/plugins/plugins.js"></script>
	<script src="__ROOT__/static/plugins/formValidator/formValidator-4.1.3.js"></script>
	<link rel="stylesheet" href="__ROOT__/static/admin/layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="__ROOT__/static/admin/layui/css/user.css" media="all" />
	<link rel="stylesheet" href="__ROOT__/static/plugins/Validform_v5.3.2/Validform_v5.3.2/demo/css/demo.css">
	<link rel="stylesheet" href="__ROOT__/static/plugins/Validform_v5.3.2/Validform_v5.3.2/demo/css/style.css">
</head>
<script>
    $(function(){
        $(".changePwd").Validform({
            tiptype:3,
            ajaxPost:true
        });

      $("#btn").click(function(){
		  var params = {};
		  params.oldPass = $.trim($("#oldPass").val());
          params.newPass = $.trim($("#newPass").val());
          params.rePass = $.trim($("#rePass").val());
          $.post("{:url('admin/Users/upPwd')}",params,function(data){
			  if(data.status>0){
			      location.href="{:url('admin/Users/upPwd')}"
			  }else{
                  layer.msg('修改失败');
			  }
          });
      })
    })
</script>
<body class="childrenBody">
	<form class="layui-form changePwd" id="myform" method="post">
		<div class="layui-form-item">
		    <label class="layui-form-label">用户名</label>
		    <div class="layui-input-block">
		    	<input type="text" value="{$login_name}" disabled class="layui-input layui-disabled"/>
		    </div>
		</div>
		<div class="layui-form-item">
		    <label class="layui-form-label">旧密码</label>
		    <div class="layui-input-block">
		    	<input type="password" value="" id="oldPass" placeholder="请输入旧密码"  datatype="*6-16" nullmsg="请设置密码！" errormsg="密码范围在6~16位之间！" lay-verify="required|oldPwd" class="layui-input pwd">
		    </div>
		</div>
		<div class="layui-form-item">
		    <label class="layui-form-label">新密码</label>
		    <div class="layui-input-block">
		    	<input type="password" value="" name="password" id="newPass" placeholder="请输入新密码" datatype="*6-16" nullmsg="请设置密码！" errormsg="密码范围在6~16位之间！" lay-verify="required|newPwd" id="oldPwd" class="layui-input pwd">
		    </div>
		</div>
		<div class="layui-form-item">
		    <label class="layui-form-label">确认密码</label>
		    <div class="layui-input-block">
		    	<input type="password" value="" id="rePass" placeholder="请确认密码" datatype="*" recheck="password" nullmsg="请再输入一次密码！" errormsg="您两次输入的账号密码不一致！" lay-verify="required|confirmPwd" class="layui-input pwd">
		    </div>
		</div>
		<div class="layui-form-item">
		    <div class="layui-input-block">
		    	<button class="layui-btn" type="submit" id="btn" lay-submit="" lay-filter="changePwd">立即修改</button>
				<button type="reset" class="layui-btn layui-btn-primary">重置</button>
		    </div>
		</div>
	</form>
	<!--<script type="text/javascript" src="__ROOT__/static/admin/layui/js/layui.js"></script>-->
	<!--<script type="text/javascript" src="__ROOT__/static/admin/layui/js/address.js"></script>-->
	<!--<script type="text/javascript" src="__ROOT__/static/admin/layui/js/user.js"></script>-->
</body>
</html>
